package com.pheruagor.handmanager.controller {
    import com.pheruagor.handmanager.model.ApplicationProxy;
    import com.pheruagor.handmanager.view.ApplicationMediator;

    import mx.core.WindowedApplication;

    import org.puremvc.as3.interfaces.*;
    import org.puremvc.as3.patterns.command.*;

    /**
     * Perform final operations when the application exits.
     *
     * <P>
     * Persist the Prefs and Data DBs </P>
     * @author Pheruagor
     */
    public class ShutdownCommand extends SimpleCommand {

        override public function execute(note:INotification):void {
            var app:WindowedApplication = WindowedApplication(note.getBody());
            facade.removeProxy(ApplicationProxy.NAME);
            facade.removeMediator(ApplicationMediator.NAME);
            app.close();
        }

    }
}